package cn.wizzer.app.user.modules.service.impl;


import cn.wizzer.app.user.modules.models.QuickReply;
import cn.wizzer.app.user.modules.services.QuickReplyService;
import cn.wizzer.framework.base.service.BaseServiceImpl;
import cn.wizzer.framework.page.Pagination;
import com.alibaba.dubbo.config.annotation.Service;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;

@IocBean(args = {"refer:dao"})
@Service(interfaceClass = QuickReplyService.class)
public class QuickReplyServiceImpl extends BaseServiceImpl<QuickReply> implements QuickReplyService {
    public QuickReplyServiceImpl(Dao dao) {
        super(dao);
    }

    @Override
    public Pagination listPage(String keyword, Integer pageNumber, Integer pageSize) {
        Cnd cnd = Cnd.NEW();
        if(Strings.isNotBlank(keyword)){
            keyword = "%" + keyword + "%";
            cnd.and("remark", "like", keyword);
        }
        return this.listPage(pageNumber, pageSize, cnd);
    }
}
